<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>
<head>

  <meta http-equiv="Content-Language" content="en-us">



  <title>IupVal</title>
  <link rel="stylesheet" type="text/css" href="../../style.css">

  <style orientation="text/css">
.style1 {
	font-size: large;
}
  </style>
</head>


<body>

<div id="navigation">
  
<ul>

    <li><a href="#Creation">Creation</a></li>

    <li><a href="#Attributes">Attributes</a></li>

    <li><a href="#Callbacks">Callbacks</a></li>

    <li><a href="#Notes">Notes</a></li>

    <li><a href="#Examples">Examples</a></li>

    <li><a href="#SeeAlso">See Also</a></li>

  
</ul>

</div>


<h2>IupVal<span class="style1"> (since 3.0)</span></h2>

<p>Creates a Valuator control. Selects a value in a limited interval. Also known 
as Scale or Trackbar in native systems.</p>

<h3><a name="Creation">Creation</a></h3>

<div>
  
<pre>Ihandle* IupVal(const char *<strong>orientation</strong>); [in C]<br>iup.val{<strong>orientation</strong>: string} -&gt; (<strong>ih</strong>: ihandle) [in Lua]<br>val(<strong>orientation</strong>) [in LED] </pre>

</div>

<p><strong>orientation</strong>: optional orientation of valuator. Can be NULL. See ORIENTATION 
attribute.</p>

  
<p>
  <u>Returns:</u> the identifier of the 
  created element, or NULL if an error occurs.</p>


<h3><a name="Attributes">Attributes</a></h3>



<p>
<a href="../attrib/iup_bgcolor.html">BGCOLOR</a>: transparent in all systems 
except in Motif. It will use the background color of the native parent.</p>

<p><strong>CANFOCUS</strong> (creation only)<strong> </strong>(<font size="3">non inheritable</font>): enables the focus traversal of the control. In Windows the control will still get the focus when clicked. Default: YES. (since 3.0)</p>

<p><strong>PROPAGATEFOCUS</strong>(<font size="3">non inheritable</font>): enables the focus callback forwarding to the next native parent with FOCUS_CB defined. Default: NO. (since 3.23)</p>

<p><strong>INVERTED</strong>: Invert the minimum and maximum positions on 
screen. When INVERTED=YES maximum is at top and left (minimum is bottom and 
right), when INVERTED=NO maximum is at bottom and right (minimum is top and 
left). The initial value depends on ORIENTATION passed as parameter on creation, if ORIENTATION=VERTICAL default is YES, if 
ORIENTATION=HORIZONTAL default is NO. (since 3.0)</p>

<p><strong>MAX</strong>:
  Contains the maximum valuator value. Default 
  is 
  "1". When changed the display will not be updated until VALUE is 
set.</p>

<p><strong>MIN</strong>:
  Contains the minimum valuator value. Default 
  is "0". When changed the display will not be updated until VALUE is 
set.</p>

<p><strong>PAGESTEP</strong>: Controls the increment for PgDn and PgUp keys. 
It is not the size of the increment. The increment size is "pagestep*(max-min)", 
so it must be 0&lt;pagestep&lt;1. Default is "0.1".</p>

<p><a href="../attrib/iup_rastersize.html">RASTERSIZE</a><strong> </strong>(<font size="3">non inheritable</font>): 
The initial size is 100 pixels along the major axis, and the handler normal size 
on the minor axis. If there are ticks then they are added to the natural size on 
the minor axis. The handler can be smaller than the normal size. Set to NULL to 
allow the automatic layout use smaller values.</p>

<p><strong>SHOWTICKS</strong> [Windows and Motif Only]: The number of tick 
  marks along the valuator trail. Minimum value is 
  "2". Default is 
  "0", 
  in this case the ticks are not shown. It can not be changed to 0 from a non 
zero value, or vice-versa, after the control is mapped. GTK does not support 
ticks.</p>

<p><strong>STEP</strong>: Controls the increment for keyboard control and the mouse 
  wheel. It is not the size of the increment. The increment size is 
"step*(max-min)", so it must be 0&lt;step&lt;1. Default is "0.01".</p>

<p><strong>TICKSPOS</strong> [Windows Only] (creation only): Allows to position 
the ticks in both sides (BOTH) or in the reverse side (REVERSE). Default: 
NORMAL. The normal position for horizontal orientation is at the top of the control, and 
for vertical orientation is at the left of the control. In Motif, the ticks 
position is always normal. (since 3.0)</p>



<p><strong>ORIENTATION </strong>(creation only) (<font size="3">non inheritable</font>):&nbsp; Informs whether the valuator is "VERTICAL" 
  or "HORIZONTAL". 
  Vertical valuators are bottom to up, and horizontal valuators are left to right variations of min to max 
(but can be inverted using INVERTED). 
Default: "HORIZONTAL".</p>

<p><strong>VALUE </strong>(<font size="3">non inheritable</font>):
  Contains a number between MIN and MAX, indicating the valuator position. 
Default: "0.0".</p>

<blockquote>
  
  <hr>
</blockquote>

<p>
<a href="../attrib/iup_active.html">ACTIVE</a>,
<a href="../attrib/iup_expand.html">EXPAND</a>, <a href="../attrib/iup_font.html">FONT</a>, <a href="../attrib/iup_screenposition.html">SCREENPOSITION</a>, 
<a href="../attrib/iup_position.html">
POSITION</a>, <a href="../attrib/iup_minsize.html">
MINSIZE</a>, <a href="../attrib/iup_maxsize.html">
MAXSIZE</a>,
    <a href="../attrib/iup_wid.html">WID</a>, <a href="../attrib/iup_tip.html">TIP</a>, 
<a href="../attrib/iup_size.html">SIZE</a>,
    <a href="../attrib/iup_zorder.html">ZORDER</a>, <a href="../attrib/iup_visible.html">VISIBLE</a>,
<a href="../attrib/iup_theme.html">THEME</a>: 
also accepted.&nbsp;</p>

<h3><a name="Callbacks">Callbacks</a></h3>


<p><strong>VALUECHANGED_CB</strong>:
  Called after the value was interactively changed by the user.</p>

<pre>int function(Ihandle *<strong>ih</strong>); [in C]<br><strong>ih</strong>:valuechanged_cb() -&gt; (<strong>ret</strong>: number) [in Lua]</pre>

    
<p class="info"><strong>ih</strong>:
  identifier of the element that activated the 
  event.</p>

<blockquote>
  
  <hr>
</blockquote>


<p><a href="../call/iup_map_cb.html">MAP_CB</a>,  
<a href="../call/iup_unmap_cb.html">UNMAP_CB</a>, 
<a href="../call/iup_destroy_cb.html">DESTROY_CB</a>, 
<a href="../call/iup_getfocus_cb.html">GETFOCUS_CB</a>,
  <a href="../call/iup_killfocus_cb.html">KILLFOCUS_CB</a>, 
<a href="../call/iup_enterwindow_cb.html">ENTERWINDOW_CB</a>,
  <a href="../call/iup_leavewindow_cb.html">LEAVEWINDOW_CB</a>, 
<a href="../call/iup_k_any.html">K_ANY</a>,
  <a href="../call/iup_help_cb.html">HELP_CB</a>: All common callbacks are 
supported.</p>

<h3><a name="Notes">Notes</a></h3>

<p>This control replaces the old <a href="../ctrl/iupval.html">IupVal</a> 
implemented in the additional controls. The old callbacks are still supported 
but called only if the VALUECHANGED_CB callback is not defined. 
The MOUSEMOVE_CB callback is only called when the user moves the handler using 
the mouse. The BUTTON_PRESS_CB callback is called only when the user press a key 
that changes the position of the handler. The BUTTON_RELEASE_CB callback is 
called only when the user release the mouse button after moving the handler.</p>

<p>In Motif, after the user clicks the handler a KILLFOCUS will be ignored when 
the control loses its focus.</p>
<p>in GTK uses GtkHScale/GtkVScale (GTK 2) or GtkScale (GTK 3), in Windows uses 
TRACKBAR_CLASS, and in Motif uses xmScale.</p>

<h4>Keyboard Mapping</h4>

<p>This is the default mapping when INVERTED has the default value, or 
ORIENTATION=HORIZONTAL+INVERTED=NO.</p>

<table align="center">

	<tbody>
    <tr>

		<th>Keys</th>

		<th>Action for HORIZONTAL</th>

	</tr>

	<tr>

		<td>Right Arrow</td>

		<td>move right, increment by one step</td>

	</tr>

	<tr>

		<td>Left Arrow</td>

		<td>move left, decrement by one step</td>

	</tr>

	<tr>

		<td>Ctrl+Right Arrow or PgDn</td>

		<td>move right, increment by one page step</td>

	</tr>

	<tr>

		<td>Ctrl+Left Arrow or PgUp</td>

		<td>move left, decrement by one page step</td>

	</tr>

	<tr>

		<td>Home</td>

		<td>move all left, set to minimum</td>

	</tr>

	<tr>

		<td>End</td>

		<td>move all right, set to maximum</td>

	</tr>

	
  </tbody>
</table>


<p>This is the default mapping when INVERTED has the default value, or 
ORIENTATION=VERTICAL+INVERTED=YES.</p>


<table align="center">

	<tbody>
    <tr>

		<th>Keys</th>

		<th>Action for VERTICAL</th>

	</tr>

	<tr>

		<td>Up Arrow</td>

		<td>move up, increment by one step</td>

	</tr>

	<tr>

		<td>Down Arrow</td>

		<td>move down, decrement by one step</td>

	</tr>

	<tr>

		<td>Ctrl+Up Arrow or PgUp</td>

		<td>move up, increment by one page step</td>

	</tr>

	<tr>

		<td>Ctrl+Down Arrow or PgDn</td>

		<td>move down, decrement by one page step</td>

	</tr>

	<tr>

		<td>Home</td>

		<td>move all up, set to maximum</td>

	</tr>

	<tr>

		<td>End</td>

		<td>move all down, set to minimum</td>

	</tr>

	
  </tbody>
</table>

	
<p>Visually all the keys move to the same direction independent from the 
	INVERTED attribute.</p>

<p>Semantically all the keys change the value depending on the INVERTED 
attribute.</p>

<p>This behavior is slightly different from the defined by the native systems 
(Home and End keys are different). But it is the same in all systems.</p>

<h3><a name="Examples">Examples</a></h3>

<p><a href="../../examples/">Browse for Example Files</a></p>


<table align="center">

	<tbody>
    <tr>

		<th>Motif</th>

		<th>Windows <br>

		Classic</th>

		<th>Windows <br>

		w/ Styles</th>

		<th>Windows <br>
Vista</th>

		<th>GTK</th>

	</tr>

	<tr>

		<td class="bg_mot"><img src="images/iupval_mot_horiz.png"></td>

		<td class="bg_win2k"><img src="images/iupval_win2k_horiz.png"></td>

		<td class="bg_winxp"><img src="images/iupval_winxp_horiz.png"></td>

		<td class="bg_vista"><img src="images/iupval_vista_horiz.png"></td>

		<td class="bg_gtk"><img src="images/iupval_gtk_horiz.png"></td>

	</tr>

	<tr>

		<td class="bg_mot"><img src="images/iupval_mot_vert.png"></td>

		<td class="bg_win2k"><img src="images/iupval_win2k_vert.png"></td>

		<td class="bg_winxp"><img src="images/iupval_winxp_vert.png"></td>

		<td class="bg_vista"><img src="images/iupval_vista_vert.png"></td>

		<td class="bg_gtk"><img src="images/iupval_gtk_vert.png"></td>

	</tr>

	
  </tbody>
</table>


</body>
</html>
